using UnityEngine;

public class PocketMouth : MonoBehaviour
{
	[SerializeField]
	private float m_SpeedThreshold;

	[SerializeField]
	private float m_SpeedLow;

	[SerializeField]
	private float m_SpeedHigh;

	public void OnTriggerEnter(Collider other)
	{
		Rigidbody component = other.GetComponent<Rigidbody>();
		if ((bool)component && component.velocity.sqrMagnitude <= m_SpeedThreshold)
		{
			float d = Mathf.Lerp(m_SpeedLow, m_SpeedHigh, component.velocity.sqrMagnitude / 16f);
			Vector3 a = -base.transform.forward.normalized;
			component.velocity = a * d;
		}
	}
}
